

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="python" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="python" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>QUANTAXIS.QAFetch.QAfinancial &mdash; QUANTAXIS 1.0.39 documentation</title>
  

  
  
  
  

  

  
  
    

  

  
    <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" /> 

  
  <script src="../../../_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="../../../index.html" class="icon icon-home"> QUANTAXIS
          

          
          </a>

          
            
            
              <div class="version">
                1.0.39
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <!-- Local TOC -->
              <div class="local-toc"></div>
            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../index.html">QUANTAXIS</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../index.html">Docs</a> &raquo;</li>
        
          <li><a href="../../index.html">Module code</a> &raquo;</li>
        
          <li><a href="../QAFetch.html">QUANTAXIS.QAFetch</a> &raquo;</li>
        
      <li>QUANTAXIS.QAFetch.QAfinancial</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <h1>Source code for QUANTAXIS.QAFetch.QAfinancial</h1><div class="highlight"><pre>
<span></span><span class="c1"># coding:utf-8</span>
<span class="c1">#</span>
<span class="c1"># The MIT License (MIT)</span>
<span class="c1">#</span>
<span class="c1"># Copyright (c) 2016-2018 yutiansut/QUANTAXIS</span>
<span class="c1">#</span>
<span class="c1"># Permission is hereby granted, free of charge, to any person obtaining a copy</span>
<span class="c1"># of this software and associated documentation files (the &quot;Software&quot;), to deal</span>
<span class="c1"># in the Software without restriction, including without limitation the rights</span>
<span class="c1"># to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
<span class="c1"># copies of the Software, and to permit persons to whom the Software is</span>
<span class="c1"># furnished to do so, subject to the following conditions:</span>
<span class="c1">#</span>
<span class="c1"># The above copyright notice and this permission notice shall be included in all</span>
<span class="c1"># copies or substantial portions of the Software.</span>
<span class="c1">#</span>
<span class="c1"># THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
<span class="c1"># IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<span class="c1"># FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<span class="c1"># AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<span class="c1"># LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
<span class="c1"># OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span>
<span class="c1"># SOFTWARE.</span>

<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">requests</span>
<span class="kn">from</span> <span class="nn">pytdx.reader.history_financial_reader</span> <span class="k">import</span> <span class="n">HistoryFinancialReader</span>
<span class="kn">from</span> <span class="nn">pytdx.crawler.history_financial_crawler</span> <span class="k">import</span> <span class="n">HistoryFinancialCrawler</span><span class="p">,</span> <span class="n">HistoryFinancialListCrawler</span>

<span class="kn">from</span> <span class="nn">QUANTAXIS.QASU.save_local</span> <span class="k">import</span> <span class="n">qa_path</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd">参见PYTDX 1.65</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="n">FINANCIAL_URL</span> <span class="o">=</span> <span class="s1">&#39;http://down.tdx.com.cn:8001/fin/gpcw.txt&#39;</span>


<div class="viewcode-block" id="get_filename"><a class="viewcode-back" href="../../../source/QUANTAXIS.QAFetch.html#QUANTAXIS.QAFetch.QAfinancial.get_filename">[docs]</a><span class="k">def</span> <span class="nf">get_filename</span><span class="p">():</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    get_filename</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="k">return</span> <span class="p">[</span><span class="n">l</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">for</span> <span class="n">l</span> <span class="ow">in</span> <span class="p">[</span><span class="n">line</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;,&quot;</span><span class="p">)</span> <span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">FINANCIAL_URL</span><span class="p">)</span><span class="o">.</span><span class="n">text</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">)]]</span></div>


<div class="viewcode-block" id="download"><a class="viewcode-back" href="../../../source/QUANTAXIS.QAFetch.html#QUANTAXIS.QAFetch.QAfinancial.download">[docs]</a><span class="k">def</span> <span class="nf">download</span><span class="p">():</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    会创建一个download/文件夹</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="n">result</span> <span class="o">=</span> <span class="n">get_filename</span><span class="p">()</span>
    <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">result</span><span class="p">:</span>
        <span class="n">r</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;http://down.tdx.com.cn:8001/fin/</span><span class="si">{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">item</span><span class="p">))</span>

        <span class="n">file</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{}{}{}{}{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">qa_path</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">sep</span><span class="p">,</span> <span class="s1">&#39;downloads&#39;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">sep</span><span class="p">,</span> <span class="n">item</span><span class="p">)</span>
        <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="s2">&quot;wb&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">code</span><span class="p">:</span>
            <span class="n">code</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">content</span><span class="p">)</span></div>


<div class="viewcode-block" id="get_and_parse"><a class="viewcode-back" href="../../../source/QUANTAXIS.QAFetch.html#QUANTAXIS.QAFetch.QAfinancial.get_and_parse">[docs]</a><span class="k">def</span> <span class="nf">get_and_parse</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">HistoryFinancialReader</span><span class="p">()</span><span class="o">.</span><span class="n">get_df</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span></div>


<div class="viewcode-block" id="prase_all"><a class="viewcode-back" href="../../../source/QUANTAXIS.QAFetch.html#QUANTAXIS.QAFetch.QAfinancial.prase_all">[docs]</a><span class="k">def</span> <span class="nf">prase_all</span><span class="p">():</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">    解析目录下的所有文件</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="n">filepath</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{}{}{}{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">qa_path</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">sep</span><span class="p">,</span> <span class="s1">&#39;downloads&#39;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">sep</span><span class="p">)</span>
    <span class="n">filename</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">listdir</span><span class="p">(</span><span class="n">filepath</span><span class="p">)</span>
    <span class="n">data</span> <span class="o">=</span> <span class="p">[]</span>
    <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">filename</span><span class="p">:</span>
        <span class="n">file</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{}{}{}{}{}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">qa_path</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">sep</span><span class="p">,</span> <span class="s1">&#39;downloads&#39;</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">sep</span><span class="p">,</span> <span class="n">item</span><span class="p">)</span>
        <span class="n">data</span> <span class="o">+=</span> <span class="n">get_and_parse</span><span class="p">(</span><span class="n">file</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">data</span></div>


<span class="n">financialmeans</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;基本每股收益&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;扣除非经常性损益每股收益&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;每股未分配利润&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;每股净资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;每股资本公积金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;净资产收益率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;每股经营现金流量&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;货币资金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;交易性金融资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应收票据&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应收账款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;预付款项&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其他应收款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应收关联公司款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应收利息&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应收股利&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;存货&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其中：消耗性生物资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;一年内到期的非流动资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其他流动资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;流动资产合计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;可供出售金融资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;持有至到期投资&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;长期应收款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;长期股权投资&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;投资性房地产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;固定资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;在建工程&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;工程物资&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;固定资产清理&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;生产性生物资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;油气资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;无形资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;开发支出&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;商誉&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;长期待摊费用&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;递延所得税资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其他非流动资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;非流动资产合计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;资产总计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;短期借款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;交易性金融负债&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应付票据&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应付账款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;预收款项&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应付职工薪酬&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应交税费&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应付利息&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应付股利&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其他应付款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应付关联公司款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;一年内到期的非流动负债&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其他流动负债&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;流动负债合计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;长期借款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应付债券&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;长期应付款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;专项应付款&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;预计负债&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;递延所得税负债&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其他非流动负债&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;非流动负债合计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;负债合计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;实收资本（或股本）&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;资本公积&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;盈余公积&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;减：库存股&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;未分配利润&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;少数股东权益&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;外币报表折算价差&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;非正常经营项目收益调整&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;所有者权益（或股东权益）合计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;负债和所有者（或股东权益）合计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其中：营业收入&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其中：营业成本&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;营业税金及附加&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;销售费用&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;管理费用&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;堪探费用&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;财务费用&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;资产减值损失&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;加：公允价值变动净收益&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;投资收益&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其中：对联营企业和合营企业的投资收益&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;影响营业利润的其他科目&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;三、营业利润&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;加：补贴收入&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;营业外收入&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;减：营业外支出&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其中：非流动资产处置净损失&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;加：影响利润总额的其他科目&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;四、利润总额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;减：所得税&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;加：影响净利润的其他科目&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;五、净利润&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;归属于母公司所有者的净利润&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;少数股东损益&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;销售商品、提供劳务收到的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;收到的税费返还&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;收到其他与经营活动有关的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营活动现金流入小计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;购买商品、接受劳务支付的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;支付给职工以及为职工支付的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;支付的各项税费&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;支付其他与经营活动有关的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营活动现金流出小计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营活动产生的现金流量净额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;收回投资收到的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;取得投资收益收到的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;处置固定资产、无形资产和其他长期资产收回的现金净额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;处置子公司及其他营业单位收到的现金净额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;收到其他与投资活动有关的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;投资活动现金流入小计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;购建固定资产、无形资产和其他长期资产支付的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;投资支付的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;取得子公司及其他营业单位支付的现金净额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;支付其他与投资活动有关的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;投资活动现金流出小计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;投资活动产生的现金流量净额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;吸收投资收到的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;取得借款收到的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;收到其他与筹资活动有关的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;筹资活动现金流入小计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;偿还债务支付的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;分配股利、利润或偿付利息支付的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;支付其他与筹资活动有关的现金&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;筹资活动现金流出小计&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;筹资活动产生的现金流量净额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;四、汇率变动对现金的影响&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;四(2)、其他原因对现金的影响&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;五、现金及现金等价物净增加额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;期初现金及现金等价物余额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;期末现金及现金等价物余额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;净利润&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;加：资产减值准备&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;固定资产折旧、油气资产折耗、生产性生物资产折旧&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;无形资产摊销&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;长期待摊费用摊销&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;处置固定资产、无形资产和其他长期资产的损失&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;固定资产报废损失&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;公允价值变动损失&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;财务费用&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;投资损失&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;递延所得税资产减少&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;递延所得税负债增加&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;存货的减少&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营性应收项目的减少&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营性应付项目的增加&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其他&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营活动产生的现金流量净额2&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;债务转为资本&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;一年内到期的可转换公司债券&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;融资租入固定资产&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;现金的期末余额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;减：现金的期初余额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;加：现金等价物的期末余额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;减：现金等价物的期初余额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;现金及现金等价物净增加额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;流动比率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;速动比率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;现金比率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;利息保障倍数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;非流动负债比率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;流动负债比率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;现金到期债务比率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;有形资产净值债务率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;权益乘数(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;股东的权益/负债合计(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;有形资产/负债合计(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营活动产生的现金流量净额/负债合计(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;EBITDA/负债合计(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应收帐款周转率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;存货周转率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;运营资金周转率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;总资产周转率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;固定资产周转率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;应收帐款周转天数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;存货周转天数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;流动资产周转率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;流动资产周转天数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;总资产周转天数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;股东权益周转率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;营业收入增长率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;净利润增长率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;净资产增长率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;固定资产增长率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;总资产增长率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;投资收益增长率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;营业利润增长率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;暂无&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;暂无&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;暂无&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;成本费用利润率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;营业利润率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;营业税金率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;营业成本率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;净资产收益率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;投资收益率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;销售净利率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;总资产报酬率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;净利润率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;销售毛利率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;三费比重&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;管理费用率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;财务费用率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;扣除非经常性损益后的净利润&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;息税前利润(EBIT)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;息税折旧摊销前利润(EBITDA)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;EBITDA/营业总收入(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;资产负债率(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;流动资产比率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;货币资金比率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;存货比率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;固定资产比率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;负债结构比&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;归属于母公司股东权益/全部投入资本(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;股东的权益/带息债务(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;有形资产/净债务(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;每股经营性现金流(元)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;营业收入现金含量(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营活动产生的现金流量净额/经营活动净收益(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;销售商品提供劳务收到的现金/营业收入(%)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营活动产生的现金流量净额/营业收入&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;资本支出/折旧和摊销&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;每股现金流量净额(元)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营净现金比率（短期债务）&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营净现金比率（全部债务）&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营活动现金净流量与净利润比率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;全部资产现金回收率&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;营业收入&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;营业利润&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;归属于母公司所有者的净利润&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;扣除非经常性损益后的净利润&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;经营活动产生的现金流量净额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;投资活动产生的现金流量净额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;筹资活动产生的现金流量净额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;现金及现金等价物净增加额&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;总股本&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;已上市流通A股&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;已上市流通B股&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;已上市流通H股&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;股东人数(户)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;第一大股东的持股数量&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;十大流通股东持股数量合计(股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;十大股东持股数量合计(股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;机构总量（家）&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;机构持股总量(股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;QFII机构数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;QFII持股量&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;券商机构数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;券商持股量&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;保险机构数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;保险持股量&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;基金机构数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;基金持股量&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;社保机构数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;社保持股量&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;私募机构数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;私募持股量&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;财务公司机构数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;财务公司持股量&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;年金机构数&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;年金持股量&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;十大流通股东中持有A股合计(股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;第一大流通股东持股量(股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;自由流通股(股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;受限流通A股(股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;一般风险准备(金融类)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;其他综合收益(利润表)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;综合收益总额(利润表)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;归属于母公司股东权益(资产负债表)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;银行机构数(家)(机构持股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;银行持股量(股)(机构持股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;一般法人机构数(家)(机构持股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;一般法人持股量(股)(机构持股)&#39;</span><span class="p">,</span>
                  <span class="s1">&#39;近一年净利润(元)&#39;</span><span class="p">]</span>
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
    <span class="c1"># download()</span>
    <span class="n">prase_all</span><span class="p">()</span>
</pre></div>

           </div>
           
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2018, yutiansut.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'../../../',
            VERSION:'1.0.39',
            LANGUAGE:'python',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: '.txt'
        };
    </script>
      <script type="text/javascript" src="../../../_static/jquery.js"></script>
      <script type="text/javascript" src="../../../_static/underscore.js"></script>
      <script type="text/javascript" src="../../../_static/doctools.js"></script>
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

  

  
  
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>